perm filename INIMF.SCR[MF,DEK] blob
sn#760409 filedate 1984-04-24 generic text, type T, neo UTF8
@x screen routines: {part of INIMF.CH originally used for debugging}
@p function init_screen:boolean;
begin init_screen←false;
end;
@#
procedure update_screen; {will be called only if |init_screen| returns |true|}
begin confusion("u");
@:this can't happen u}{\quad u@>
end;
@y
@p function INITSC:boolean; extern;@t\2@>@/
function init_screen:boolean;
var @!b:boolean;
begin print_nl("Calling INITSC:");
b←INITSC;
if b then print("true")@+else print("false");
init_screen←b;
end;
procedure UPDSCR; extern;
procedure update_screen;
begin print_nl("Calling UPDSCR");
UPDSCR;
end;
@z
@x
@p procedure blank_rectangle(@!left_col,@!right_col:screen_col;
@!top_row,@!bot_row:screen_row);
var @!r:screen_row;
@!c:screen_col;
begin @{@+for r←top_row to bot_row-1 do
for c←left_col to right_col-1 do
screen_pixel[r,c]←white;@+@}@/
confusion("b"); {|blank_rectangle| is called only after |init_screen=true|}
@:this can't happen b}{\quad b@>
end;
@y
@p procedure BLANKR(@!left_col,@!right_col:screen_col;
@!top_row,@!bot_row:screen_row); extern;@t\2@>@/
procedure blank_rectangle(@!left_col,@!right_col:screen_col;
@!top_row,@!bot_row:screen_row);
begin print_nl("Calling BLANKR("); print_int(left_col); print_char(",");
print_int(right_col); print_char(","); print_int(top_row); print_char(",");
print_int(bot_row); print_char(")");
BLANKR(left_col,right_col,top_row,bot_row);
end;
@z
@x
@p procedure paint_row(@!r:screen_row;@!b:pixel_color;var @!a:trans_spec;
@!n:screen_col);
var @!k:screen_col; {an index into |a|}
@!c:screen_col; {an index into |screen_pixel|}
begin @{ k←0; c←a[0];
repeat incr(k);
repeat screen_pixel[r,c]←b; incr(c);
until c=a[k];
b←black-b; {$|black|\swap|white|$}
until k=n;@+@}@/
confusion("p"); {|paint_row| is called only after |init_screen=true|}
@:this can't happen p}{\quad p@>
end;
@y
@p procedure PAINTR(@!r:screen_row;@!b:pixel_color;var @!a:trans_spec;
@!n:screen_col); extern;@t\2@>@/
procedure paint_row(@!r:screen_row;@!b:pixel_color;var @!a:trans_spec;
@!n:screen_col);
var @!k:screen_col; {an index into |a|}
begin print_nl("Calling PAINTR(");
print_int(r); print_char(","); print_int(b); print_char(";");
for k←0 to n do
begin print_int(a[k]); if k≠n then print_char(",");
end;
print_char(")");
PAINTR(r,b,a,n);
end;
@z